function submit(){
  var name = $("#name").val();
  var mobile = $("#mobile").val();
  var ticket = $("#ticket").val();
  if(!name){
    return showErrorMsg("用户名不得为空！");
  }
  if(!mobile){
    return showErrorMsg("手机号码不得为空！");
  }
  var param = {};
  param.name = name;
  param.mobile = mobile;
  param.ticket = ticket;
  $.ajax({
    url : "/user/bind_openid",
    data : param,
    type : "POST",
    dataType : "json",
    success : function(resp){
      $('#error_msg').attr("class", "am-alert am-alert-success");
      $("#error_msg").html("操作成功!");
      $("#error_msg").show();
    },
    error : handlerError
  })
}

function showErrorMsg(msg){
  $('#error_msg').attr("class", "am-alert am-alert-danger");
  $("#error_msg").html(msg);
  $("#error_msg").show();
}


function handlerError(resp){
  if(resp && resp.responseJSON){
    showErrorMsg(resp.responseJSON.error)
  }else{
    showErrorMsg("系统发生异常！");
  }
}

function handlerSuccess(resp){

}